package com.eazyimage.lab.controller;

import com.eazyimage.lab.service.AddDatasetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.eazyimage.lab.entity.Response;

import java.io.File;

@RestController
public class AddDatasetController {
    @Autowired
    AddDatasetService ad;
    @RequestMapping("/AddDataset")
    public Response AddDataset(@RequestParam("datasetName")String datasetName,
                               @RequestParam("datasetDescription")String datasetDescription,
                               @RequestParam("username")String username, @RequestParam("count")int count,
                               @RequestParam("photo_width")int photo_width, @RequestParam("photo_height")int photo_height,
                               @RequestParam("ispublic")int ispublic, @RequestParam("label_list")String label_list) {
        if(ad.AddDataset(datasetName, datasetDescription, username, count, photo_width, photo_height,
                ispublic, label_list)){
            return Response.success();
        }

        return Response.fail();
    }

}
